import Vue from 'vue'
import App from './App'
import navigateToX from './common/js/navigateToX.js'

// 加载
Vue.prototype.$londing = (title = '加载中', time = 600) => {
	uni.showLoading({
		title: title,
		mask: true
	})
	setTimeout(() => {
		uni.hideLoading()
	}, time)
}
Vue.prototype.$msg = (title, duration = 800, mask = false, icon = 'none') => {
	if (Boolean(title) === false) { //统一text提示方便全局修改
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}
Vue.prototype.$routerX = navigateToX;
Vue.config.productionTip = false;
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()

//注册全局事件
Vue.prototype.$eventBus = new Vue()